/*
 * @Author       : Thyssen Wen
 * @Date         : 2022-10-04 08:39:38
 * @LastEditors  : Thyssen Wen
 * @LastEditTime : 2022-10-04 09:28:21
 * @Description  : Singleton Class
 * @FilePath     : /cdesign-pattern/Singleton/Singleton.h
 */
#pragma once
#include <iostream>
using namespace std;

class Singleton
{
private:
    static Singleton *ptr_singleton;
    Singleton();
    ~Singleton();
public:
    static Singleton *getInstance(){
        return ptr_singleton;
    }
};

Singleton* Singleton::ptr_singleton = new (std::nothrow) Singleton();

Singleton::Singleton()
{
    cout << "Generate a single Instance." << endl;
}

Singleton::~Singleton()
{
}
